#include "stm32f10x.h"                  // Device header
#include "Delay.h"
#include "OLED.h"
#include "Serial.h"
#include "Pwm.h"
#include "MOVE.H"
#include "PID.h"
#include "TIM.h"


extern int16_t Serial_RxPacket[];
extern int pre_X_PWM;
uint16_t i = 0;

int main(void)
{
	/*模块初始化*/
	OLED_Init();		//OLED初始化
	Serial_Init();		//串口初始化
	OLED_ShowString(1,1,"data1:");
	OLED_ShowString(2,1,"data2:");	
	TIM2_PWM_Init();
	Timer_Init();
	while (1)
	{
			OLED_ShowHexNum(1, 8, Serial_RxPacket[1], 2);
			OLED_ShowHexNum(2, 8, Serial_RxPacket[2], 2);
		OLED_ShowSignedNum(3,1,Serial_RxPacket[1]-160,3);
		OLED_ShowSignedNum(4,1,pre_X_PWM,4);
	}
}
